import axios from "./http.js";
import _ from "lodash";

/*
 * 预警管理
 */
// 获取预警列表
export function getWarningSettingList(config) {
  let url = "/bs/warning/setting/list";
  const opts = _.merge({}, config || {});

  return axios.get(url, opts);
}

// 添加或编辑预警设置
export function addWarningSetting(data, config) {
  let url = "/bs/warning/setting/save";

  data = data || {};
  config = config || {};
  return axios.post(url, data, config);
}
// 删除预警设置
export function deleteWarningSetting(data, config) {
  let url = "/bs/warning/setting/delete";

  data = data || {};
  config = config || {};
  url = url + "/" + data.id;
  delete data.id;
  return axios.post(url, data, config);
}
